home *** CD-ROM | disk | FTP | other *** search
- /********************************************************************
- * *
- * WinLIB PRO header file *
- * *
- * The ULTIMATE Object-Oriented programming library available for *
- * the C language on the Atari platform of computers. *
- * *
- * Combines ideas from Enhanced GEM, Compact GEM, GEM++, WindClass,*
- * Application Library, Windows 3.1, Windows 4.0, Motif, Openlook, *
- * NeXTDesk, MultiTOS, Geneva, InterFace (EXTOBFIX), XAES, XAES *
- * PRO, WAZ Text Library, Window Extensions (WinX), Mag!x, and *
- * WX_LIB *
- * *
- * Combines interface designs from InterFace, MultiTOS, Geneva, *
- * NeXT, WindDesk, Windows 3.1, OS/2, and MultiWIN. *
- * *
- * Copyright (c) Clever Bits and Bitgate Software 1992 - 1994 *
- * All Rights Reserved. *
- * *
- * Programmed by Ken Hollis (khollis@bitsink.gbdata.com) *
- * Karl Øygard (karlo@ifi.uio.no) *
- * and Markus Gutschke (gutschk@uni-muenster.de) *
- * *
- * Program start date: 22.12.1992 *
- * Program end date : 01.12.1994 (Estimated) *
- * Language : Non-ANSI C *
- * Compatibility : Pure C, Turbo C *
- * Required system : Atari 520ST, 512K, TOS 1.0 *
- * *
- ********************************************************************/
-
- #include <aes.h>
- #include <vdi.h>
-
- #ifndef __WINLIB__
- #define __WINLIB__ /* WinLIB PRO Header file identifier */
- #define __WLVER__ 0x0060 /* WinLIB PRO Current Version */
- #endif
-
- #ifndef min
- #define min(a,b) ((a) < (b) ? (a) : (b)) /* Minimum value */
- #define max(a,b) ((a) > (b) ? (a) : (b)) /* Maximum value */
- #endif
-
- #ifndef GLOBAL
- #define GLOBAL
- #define LOCAL static
- #endif
-
- #ifndef BOOL
- #define BOOL int
- #endif
-
- #ifndef UnusedVar
- #define UnusedVar(x) ((void)(x))
- #endif
-
- #define AES_VERSION _GemParBlk.global[0] /* Version of AES */
-
- #ifndef AP_DRAGDROP
- #define AP_DRAGDROP 63
- #endif
-
- /* Atari's section for Drag-and-drop */
- #define DD_OK 0 /* Information was handled */
- #define DD_NAK 1 /* Cannot process information */
- #define DD_EXT 2 /* Don't understand this file type */
- #define DD_LEN 3 /* File length is too large */
- #define DD_TRASH 4 /* Dropped on to trashcan */
- #define DD_PRINTER 5 /* Dropped on to printer */
- #define DD_CLIPBOARD 6 /* Dropped on to clipboard */
-
- /* Milliseconds to wait before timeout */
- #define DD_TIMEOUT 4000
-
- /* Number of bytes of "preferred extensions" sent by receipient
- * during open */
- #define DD_NUMEXTS 8
- #define DD_EXTSIZE 32L
-
- /* Max size of a drag-and-drop item name */
- #define DD_NAMEMAX 128
-
- /* Max length of a drag-and-drop drop header */
- #define DD_HDRMAX (8+DD_NAMEMAX)
-
- #define WM_CREATED 24893 /* Successful creation */
- #define WM_KILL 24894 /* Window about to be killed */
- #define WM_DIALOG 24895 /* Dialog action */
- #define WM_KEYBD 24896 /* Key press */
- #define WM_BUTTON 24897 /* Button press */
- #define WM_TEXT 24898 /* Hottext selection */
- #define WM_HOTKEY 24899 /* Hotkey selection */
- #define WM_FKEY 24900 /* Function key selection */
- #define WM_HELP 24901 /* Help key selection */
- #define WM_UNDO 24902 /* Undo key selection */
- #define WM_KBRESET 24903 /* Keyboard reset (TOS 1.0-1.2) */
- #define WM_MENU 24904 /* Menu selection */
- #define WM_PAINT 24905 /* Paint rectangle after redraw */
- #define WM_TIMER 24906 /* Do timer action */
- #define WM_TIMECHG 24907 /* Timer mode change */
- #define WM_ICONIFIED 24908 /* Window iconified */
- #define WM_UNICONIFIED 24909 /* Window uniconified */
- #define WM_CLEARBUF 24999 /* Clear message buffer */
-
- #define WC_NOTOBJECTABLE 0 /* Window can be closed w/o asking */
- #define WC_OBJECTABLE 1 /* Pause before closing window */
- #define WC_FORCED 2 /* Force window to be closed */
-
- /* Extended Object Types */
- #define SCALE 16 /* Automatic scaling of image */
- #define FLYING 17 /* Flying dialog mover */
- #define CUSTOM 18 /* Custom arrow buttons */
- #define CHECKBOX CUSTOM /* "X" Selectable box */
- #define RADIOBTN CUSTOM /* Radio button circle cell */
- #define POPUPBTN CUSTOM /* Popup button type */
- #define UNDERLINE 19 /* Underlined text */
- #define BOXFRAME 20 /* Box frame for selections */
- #define BOXTITLE 20 /* Box frame for selections */
- #define HELPBTN 21 /* Activation button under [HELP] */
- #define CYCLEBTN 22 /* Cycle button for popup menus */
- #define CIRCLE 22 /* Cycle button for popup menus */
- #define CUSTBTN 24 /* Custom Selection and Radio boxes */
- #define DROPDOWN 25 /* Dropdown button for dropdown selections */
- #define MENUDETATCH 30 /* Detatchable menu bar */
- #define UNDOBTN 31 /* Activation button under [UNDO] */
- #define MENULINE 40 /* Thick line for separator */
- #define MENUEFFECTS 41 /* Menu item effects */
-
- /* Window handles - GLOBAL */
- #define DESKTOP 0 /* Desktop window handle */
-
- /* Standard Extended Object Flags */
- #ifdef OBFLAGS11 /* (New AES bindings available?) */
- #define HANDSLIDE OBFLAGS12 /* Hand shown for slider */
- #define MENUSIDE OBFLAGS13 /* Menu with side items */
- #define BOXFRAMETITLE OBFLAGS15 /* Box frame title with box around it */
- #else
- #define HANDSLIDE 0x0800 /* See above */
- #define MENUSIDE 0x2000
- #define BOXFRAMETITLE 0x8000
- #endif
-
- /* Standard Extended Object States */
- #ifdef OBSTATE15 /* New AES bindings available? */
- #define MENUTYPE OBSTATE13 /* Object is a menu title */
- #define ALREADYMOD OBSTATE14 /* Already modified for sizing (temporary state) */
- #define FAKED3D OBSTATE15 /* Faked 3D setting for Falcon */
- #else
- #define MENUTYPE 0x2000 /* See above */
- #define ALREADYMOD 0x4000
- #define FAKED3D 0x8000
- #endif
-
- #ifndef DRAW3D
- #define DRAW3D 0x0080 /* MultiTOS/Falcon Draw3D setting */
- #endif
-
- /* Extended/Enhanced Boolean values. These are supported by Atari. */
- #define TRUE 1 /* Boolean TRUE */
- #define FALSE 0 /* Boolean FALSE */
- #define FAIL -1 /* Boolean FAIL */
- #define INTERNALFAIL -2 /* Boolean NON-Recoverable FAIL */
- #define NOMORE FAIL /* Window open failure (no more wins) */
-
- /* Text movement (for text routines) */
- #define TEXT_UP -1 /* Text moved up */
- #define TEXT_DOWN 1 /* Text moved down */
-
- /* Scaling settings */
- #define NO_SCALING 0 /* No scaling is done */
- #define SCALING 1 /* All/complete scaling is performed */
- #define TEST_SCALING 2 /* Icon mask scaling is done */
- #define DARK_SCALING 4 /* Icon data scaling is done */
-
- /* Window states (oh, there's just TOO many states!) */
- #define W_OPEN 0x01 /* Window is currently opened */
- #define W_MINIMIZED 0x02 /* Window is minimized */
- #define W_UNUNTOPPABLE 0x04 /* Window cannot be untopped */
- #define W_FULLERMINIMIZES 0x08 /* Window fuller box minimizes */
- #define W_BEVENT 0x10 /* Window accepts bkgnd clicks */
- #define W_MODAL 0x20 /* Window is modal */
- #define W_FLYING 0x40 /* Window is a flying dialog */
- #define W_TEXT 0x80 /* Window is a text window */
- #define W_ICONIFIED 0x0100 /* Window is iconified */
- #define W_FULLERICONIFIES 0x0200 /* Window fuller box iconifies */
- #define W_TIMER 0x0400 /* Window is a timer */
- #define W_DIALOG 0x0800 /* Window is a dialog */
- #define W_DESKTOP 0x1000 /* Window is the desktop */
- #define W_FULLERCHOOSES 0x2000 /* Window fuller box chooses new state */
- #define W_RESERVED1 0x4000 /* Reserved */
- #define W_RESERVED2 0x8000 /* Reserved */
-
- /* Window styles */
- #define S_FULLERMINIMIZES 0x0001 /* Fuller box minimizes window */
- #define S_FULLERICONIFIES 0x0002 /* Fuller box iconifies window */
- #define S_FULLERCHOOSES 0x0004 /* Fuller box chooses either one */
- #define S_MULTICOPYABLE 0x0008 /* All windows containing this same tree will be drawn if an action occurs */
- #define S_RESERVED0 0x0010
- #define S_RESERVED1 0x0020
- #define S_RESERVED2 0x0040
- #define S_RESERVED3 0x0080
- #define S_RESERVED4 0x0100
- #define S_RESERVED5 0x0200
- #define S_RESERVED6 0x0400
- #define S_RESERVED7 0x0800
- #define S_RESERVED8 0x1000
- #define S_RESERVED9 0x2000
- #define S_RESERVED10 0x4000
- #define S_RESERVED11 0x8000
-
- /* Quick window states. This is used when calling WCreateWindow,
- and it's the first element used when calling it. */
- #define W_DIALOGICON W_OPEN | W_DIALOG | W_BEVENT | W_FULLERICONIFIES
- #define W_DIALOGMINI W_OPEN | W_DIALOG | W_BEVENT | W_FULLERMINIMIZES
- #define W_ALERT W_OPEN | W_FULLERMINIMIZES | W_UNUNTOPPABLE | W_DIALOG | W_MODAL
- #define W_DIALOGCHOOSE W_OPEN | W_DIALOG | W_BEVENT | W_FULLERCHOOSES
- #define W_ALERTCHOOSE W_OPEN | W_FULLERCHOOSES | W_UNUNTOPPABLE | W_DIALOG | W_MODAL
- #define W_FLYINGWIN W_OPEN | W_DIALOG | W_FLYING | W_BEVENT
- #define W_TEXTWIN W_OPEN | W_TEXT
-
- /* Quick window styles. This will be modified soon. */
- #define S_COPYABLE S_MULTICOPYABLE
-
- /* Window TYPE attributes */
- #define W_TEXT_ATTRIBUTES NAME|CLOSER|FULLER|MOVER|SIZER|UPARROW|DNARROW|VSLIDE
- #define W_MOVE_ATTRIBUTES NAME|MOVER
- #define W_DIAINF_ATTRIBUTES NAME|CLOSER|FULLER|MOVER|INFO
- #define W_FLYING_ATTRIBUTES 0
-
- /* Window creation types. */
- #define WF_MINIMIZE 24890 /* Minimizable window */
- #define WF_UNUNTOPPABLE 24891 /* Cannot untop window */
- #define WF_MODAL 24892 /* Modal dialog box */
- #define WF_ICONIFYWL 24893 /* Iconifiable window */
- #define WF_FLYING 24894 /* Flying Dialog window */
- #define WF_TEXT 24895 /* Text window */
- #define WF_TIMER 24896 /* Timer window */
- #define WF_DIALOG 24897 /* Dialog window */
- #define WF_CUSTOMWIN 24898 /* Customized window */
-
- /* Timer status modes. The PAUSED and RESUMED modes are not yet
- functioning, because we don't have multiple timer access yet.
- These are passed in msg_buf[4]. */
- #define T_STOPPED 0 /* Timer stopped */
- #define T_RUNNING 1 /* Timer running */
- #define T_PAUSED T_STOPPED /* Timer "paused" */
- #define T_RESUMED T_RUNNING /* Timer resumed */
- #define T_ALLSTOP 2 /* All timers stopped */
- #define T_ALLRUN 3 /* All timers running */
- #define T_ALLPAUSE T_ALLSTOP /* All timers "paused" */
- #define T_ALLRESUME T_ALLRUN /* All timers resumed */
-
- /* Hotkey indeces. This changes the style of the hotkey activator
- keys. Since we "hack" the character to activate in the upper 8
- bits, these can be set to change the style to activate that key. */
- #define HOTKEY_NONE 0 /* NO Hotkeys */
- #define HOTKEY_UNDERLINE 1 /* Hotkeys are underlined */
- #define HOTKEY_RED 2 /* Hotkeys are RED */
- #define HOTKEY_INVERSE 3 /* Hotkeys are inverted */
-
- /* Box fill types for selectable "side" items. These will probably
- be removed... I don't see a use for them. Maybe I can add a
- "WS_COLOR" for Color Icons when we get them installed. */
- #define WS_BOXED 1
- #define WS_XED 2
- #define WS_COMBO 3
-
- /* Hottext types. */
- #define HT_NONE 0 /* No difference in drawing style */
- #define HT_BOLD 1 /* Boldfaced text */
- #define HT_LIGHT 2 /* Lightened text */
- #define HT_ITALICS 4 /* Italicized text */
- #define HT_ULINE 8 /* Underlined text */
- #define HT_OUTLINE 16 /* Outlined text */
-
- /* Dialog flag types. These will probably be replaced by FL3DBAK,
- FL3DIND, and FL3DACT. */
- #define F_3DBIT_1 0x200 /* 3D Background bit */
- #define F_3DBIT_2 0x400 /* 3D Foreground bit */
- /* Both of the above two bits enabled is a 3D Activation object */
-
- /* 3D Internal Drawing Types. Yay! Our 3D types. Notice, there's
- *SIX* different styles, and each one takes up only 2.3K for
- overhead... Not bad if I say so myself. (MultiTOS's 3D routines
- take up 45K overhead!) */
- #define L_MULTITOS 0 /* MultiTOS / TOS 4.04+ look */
- #define L_CUSTOM 1 /* Olaf Meisiek's Zoom! look */
- #define L_MOTIF 2 /* XWindows/Motif look (X11R5) */
- #define L_GENEVA 3 /* Geneva's MultiTOS (modified) look */
- #define L_WINLIB 4 /* WinLIB Pro's own custom look */
- #define L_STANDARD 5 /* Standard look for normal TOS (no 3D) */
-
- /* Window slider bar/arrow messages in plain english. These are
- variants on the Pure C indices, this is just easier to read. */
- #define PAGE_UP 0 /* Page up selected */
- #define PAGE_DOWN 1 /* Page down selected */
- #define LINE_UP 2 /* Line up selected */
- #define LINE_DOWN 3 /* Line down selected */
- #define PAGE_LEFT 4 /* Page left selected */
- #define PAGE_RIGHT 5 /* Page right selected */
- #define COLUMN_LEFT 6 /* Column left selected */
- #define COLUMN_RIGHT 7 /* Column right selected */
-
- /* Mouse forms. These are the custom mouse forms that are called with
- WGrafMouse. These are currently used for the custom windows (will
- be used) and for loading and initializing stuff.. */
- #define INIT_MOUSE 50 /* Computer-type mouse */
- #define LOAD_MOUSE 51 /* Resource mouse */
- #define LRSLIDE_MOUSE 52 /* Left/right slider */
- #define UDSLIDE_MOUSE 53 /* Up/down slider */
- #define URMOVE_MOUSE 54 /* Upper-right sizer */
- #define ULMOVE_MOUSE 55 /* Upper-left sizer */
- #define LLMOVE_MOUSE 56 /* Lower-left sizer */
- #define LRMOVE_MOUSE 57 /* Lower-right sizer */
- #define CLIP_MOUSE 58 /* Clipboard mouse */
- #define DIALOG_MOUSE 59 /* Dialog box mouse */
- #define TEXT_MOUSE 60 /* Text mouse */
- #define TIMER_MOUSE 61 /* Timer mouse */
- #define TRASH_MOUSE 62 /* Trashcan mouse */
- #define ANIMATED_MOUSE 300 /* Animated mouse */
- #define COLOR_MOUSE 301 /* Colour mouse (yeah right... Do THAT legally) */
-
- /* Mouse form tools. This is for mouse animation, and for other
- tools if the programmer wants to store mouse shapes from loading
- in from memory, or if they create a mouse tool. Very handy. */
- #define GET_MOUSE 400 /* Get current mouse form index */
- #define SAVE_MOUSE 401 /* Save current mouse form index */
- #define PREV_MOUSE 402 /* Get previous mouse form index */
- #define NEXT_MOUSE 403 /* Get next mouse form index */
- #define FIRST_MOUSE 404 /* Get first mouse form index */
- #define LAST_MOUSE 405 /* Get last mouse form index */
- #define CLEAR_MOUSE 406 /* Clear all mice indices */
- #define FIND_MOUSE 407 /* Find mouse form index */
- #define NEWPOS_MOUSE 408 /* Reposition counter */
-
- /* WAppl_GetInfo indices. These are essentially the same indices that
- are used in TOS 4.04, just varied a bit. We added our own "spice"
- to it, so it works with WinLIB PRO and ALL versions of TOS. */
- #define APGI_REGFONT 0 /* Regular font information */
- #define APGI_SMFONT 1 /* Small font information */
- #define APGI_COLORS 2 /* Resolution and color information */
- #define APGI_LANGUAGE 3 /* Language information */
- #define APGI_ENVIRON1 4 /* Environment #1 */
- #define APGI_ENVIRON2 5 /* . #2 */
- #define APGI_ENVIRON3 6 /* . #3 */
- #define APGI_RESVD1 7 /* Reserved for OS usage */
- #define APGI_MOUSE 8 /* Mouse support information */
- #define APGI_MENU 9 /* Menu support information */
- #define APGI_SHEL 10 /* Shel_write information */
- #define APGI_WINDOW 11 /* Extended WF_ support information */
- #define APGI_MESSAGE 12 /* Extended message information */
- #define APGI_OBJLIB 13 /* Object library information */
- #define APGI_FORMLIB 14 /* Form library information */
- #define APGI_WLGETINFO -1 /* Get WinLIB PRO information (general) */
-
- /* Search element names for WLocateWindow. This makes it easy for
- routines and the programmer to find a window that has this info
- inside it. WLocateWindow only stops at the first window it finds,
- but that will change soon. */
- #define SHANDLE 'HNDL' /* AES Window Handle */
- #define SSTATE 'STAT' /* Window state (W_OPEN, etc) */
- #define SKIND 'KIND' /* Window kind */
- #define SEDITOBJECT 'EOBJ' /* Starting edit object */
- #define SEDITPOS 'EPOS' /* Cursor position inside edit object */
- #define SHASEDIT 'HASE' /* If window has an editable object */
- #define SEDITDISP 'EDSP' /* If the cursor is displayed */
- #define STOPLINE 'TPLN' /* Top line of text (current position) */
- #define SAMOUNTMOVED 'AMTM' /* Amount of text moved */
- #define STOPPOINTER 'TOP_' /* Top pointer of text */
- #define STREE 'TREE' /* Find window with OBJECT TREE */
- #define SICON 'ICON' /* Find window with icon number */
-
- /* Dominance settings for windows */
- #define D_NONE 0 /* No dominance (not W_UNUNTOPPABLE) */
- #define D_ALWAYSTOP 1 /* Always on top, no matter what */
- #define D_SWITCHABLE 2 /* Can switch between W_UNUNTOPPABLEs */
- #define D_NOTTOPPABLE 3 /* Window cannot be topped or used */
-
- /* Define XACC Messages */
- #ifndef ACC_ID
- #define ACC_ID 0x400 /* Get Accessory ID */
- #define ACC_OPEN 0x401 /* Open accessory */
- #define ACC_CLOSE 0x402 /* Close accessory */
- #define ACC_ACC 0x403 /* Accessory accessed */
- #define ACC_EXIT 0x404 /* Accessory exited */
- #define ACC_ACK 0x500 /* Acknowledgement */
- #define ACC_TEXT 0x501 /* Text send */
- #define ACC_KEY 0x502 /* Keyboard send */
- #define ACC_META 0x503 /* Metafile send */
- #define ACC_IMG 0x504 /* Image send (Color or B/W) */
- #endif
-
- /* Edit validation string check return values */
- #define E_NUMERIC 1
- #define E_UP_ASCII 2
- #define E_LOW_ASCII 3
- #define E_UP_NUMERIC 4
- #define E_LOW_NUMERIC 5
- #define E_UP_PATH 6
- #define E_LOW_PATH 7
- #define E_ANY 8
- #define E_SPECIAL 9
-
- typedef struct hotkeys {
- char key;
- int objnum;
- } HOTKEYS;
-
- /* These are the high resolution and low resolution images */
- typedef struct image
- {
- int *hi_on, *hi_off, *lo_on, *lo_off;
- } IMAGE;
-
- typedef struct images
- {
- int count;
- IMAGE *image;
- } IMAGES;
-
- typedef struct timer
- {
- long clock;
- long ev_mtcount; /* Timer counter */
- void *user; /* User parameters to give Dispatcher routine */
- int status; /* Status of timer */
- } TIMER;
-
- typedef struct window
- {
- int handle; /* Handle of window */
- int state; /* Current state of window */
- int style; /* Extended states (style) for window */
- int kind; /* Visual attributes of window */
- int dominance; /* How dominant the W_UNUNTOPPABLE setting is */
- GRECT size;
- char title[128], info[128], origtitle[128];
- /* Title, info and original (untouched) title for window */
- struct window *prev, *next; /* Pointer to previous and next window in chain */
- OBJECT *menubar; /* Menu bar */
- OBJECT *tree; /* Pointer to resource tree */
- int treenumber; /* Tree number of the found resource */
- int edobject, edpos; /* First editable field in resource tree, and position of cursor */
- BOOL has_edit; /* Does the dialog box have an editable object? */
- BOOL edit_disp; /* Editing cursor displayed flag */
- int slidpos[10],slidmax[10]; /* Position and maximum position of sliders at any given time */
- long slidacc[10],slidstep[10]; /* Slider accumulator and step accumulator for the slider routine */
- void *WndDispatcher; /* Dispatcher procedures for window */
- void *user; /* User parameters to give Dispatcher routines */
- int popups[20]; /* These are the selections that have been clicked for your popups. */
- HOTKEYS hot_keys[20]; /* Hotkey (dialog) information */
- HOTKEYS hot_text[20]; /* Hotkey (text) information */
- int objnumber; /* Iconified window object number */
- TIMER timer; /* Timer information */
- } WINDOW;
-
- typedef struct extinfo
- {
- char *te_ptext; /* Pointer to text string */
- char *te_ptmplt; /* Pointer to text template */
- char *te_pvalid; /* Pointer to validation string */
- int te_font; /* Font size */
- int te_junk1; /* Unused */
- int te_just; /* Text justification */
- struct
- {
- unsigned int bord_color : 4;
- unsigned int text_color : 4;
- unsigned int transparency : 1;
- unsigned int fill_ptn : 3;
- unsigned int in_color : 4;
- } te_color; /* Color */
- int te_junk2;
- int te_thickness; /* Border thickness */
- char te_character, nullterm;
- int te_txtlen; /* Text length */
- int te_tmplen; /* Length of template */
- void *oldparm;
- int oldtype;
- } EXTINFO;
-
- typedef struct extended_rshdr
- {
- unsigned int rsh_vrsn; /* should be 3 */
- unsigned int rsh_extvrsn; /* not used, initialised to 'IN' for Interface */
- unsigned long rsh_object;
- unsigned long rsh_tedinfo;
- unsigned long rsh_iconblk; /* list of ICONBLKS */
- unsigned long rsh_bitblk;
- unsigned long rsh_frstr;
- unsigned long rsh_string;
- unsigned long rsh_imdata; /* image data */
- unsigned long rsh_frimg;
- unsigned long rsh_trindex;
- unsigned long rsh_nobs; /* counts of various structs */
- unsigned long rsh_ntree;
- unsigned long rsh_nted;
- unsigned long rsh_nib;
- unsigned long rsh_nbb;
- unsigned long rsh_nstring;
- unsigned long rsh_nimages;
- unsigned long rsh_rssize; /* total bytes in resource */
- } RSXHDR;
-
- typedef struct applinfo
- {
- /* Standard messages */
- int resnum; /* Current resolution */
- int colsup; /* Number of colors supported */
- int colicons; /* Color icons supported */
- int newrsc; /* New resource file supported */
- int langidx; /* Language index */
- int multitask; /* Preemptive multitasking */
- int extndapfind; /* Extended ap_find */
- int applsrch; /* Appl_search */
- int rcfix; /* rsrc_rcfix */
- int objcxfind; /* objc_xfind */
- int menuclick; /* menu_click */
- int shel_w_r; /* shel_write/shel_read */
- int applread; /* appl_read(-1) */
- int shelget; /* shel_get(-1) */
- int mbar1; /* menu_bar(-1) */
- int mbar2; /* menu_bar(MENU_INSTL) */
- int gmouse; /* graf_mouse(258-260) */
- int osmouse; /* Mouse maintained by OS */
- int submnus; /* Submenus supported */
- int popupmnus; /* Popup menus supported */
- int scrollable; /* Scrollable menus supported */
- int exmnsel; /* Extended MN_SELECTED */
- int wf_support; /* Extended WF_ support */
- int wf_gadgets; /* New window gadget support */
- int extra_msgs; /* Extra messages supported */
- int msgbitfld; /* Bitfield of extra messages supported */
- int msg_behavior; /* Message behavior */
- int obj3d; /* 3D Objects supported */
- int sysvar; /* objc_sysvar */
- int tedinfofonts; /* Fonts in TEDINFO structures */
- int fldial; /* Flying dialogs supported */
- int magix; /* Mag!x keyboard conversion tables */
- int cpret; /* Cursor position always returned */
-
- /* WinLIB Standard messages */
- int wlver; /* Current version of WinLIB PRO */
- } APINFO;
-
- typedef struct mouseforms
- {
- int forms[16];
- } MICE;
-
- typedef struct
- {
- long cookie_id; /* Cookie ID number */
- long cookie_value; /* Points to your cookie data */
- } COOKIE;
-
- typedef struct
- {
- unsigned long magic; /* Installed magic */
-
- /* struct {
- unsigned long magic; /* 3D Installed magic number */
- BOOL mtlook; /* MultiTOS look */
- BOOL zoomlook; /* Zoom! look */
- BOOL motiflook; /* Motif (X11R5) look */
- BOOL genlook; /* Geneva look */
- BOOL winlook; /* WinLIB PRO look */
- int def_low; /* 16+ colors default look */
- int def_high; /* >=4 colors default look */
- } draw3d;
-
- unsigned long textmagic; /* Text windows magic number */
-
- struct {
- unsigned long magic; /* Custom desktop menus magic number */
- BOOL sideroot; /* Side rooted menus supported */
- BOOL scrolling; /* Scrollable menus supported */
- BOOL popup; /* Popup menus supported */
- BOOL dropdown; /* Dropdown menus supported */
- BOOL draw3d; /* 3D menus (desktop) supported */
- int style; /* Popup or dropdown flag (if supported) */
- } custmenu;
-
- struct {
- unsigned long magic; /* Custom desktop routines magic number */
- BOOL pictures; /* Desktop picture support */
- BOOL iconmouse; /* Iconic mouse support */
- BOOL multidrag; /* Multiple icon dragging support */
- BOOL dragdrop; /* Drag-and-drop support */
- BOOL icon_mf; /* Flag using mouse change or ghost rect */
- } deskrouts;
-
- unsigned long xaes_vdimagic; /* XAES and XVDI routines */
-
- struct {
- unsigned long magic; /* Custom resource routines magic number */
- BOOL largefile; /* >64K file size support */
- BOOL autofix; /* Automatic EObT fix support */
- } resource;
-
- unsigned long clipbrd_magic; /* Clipboard management routines */ */
- } PROGCOOKIE;
-
- typedef struct winlib_infocook
- {
- int v_winlib;
- int v_xvdi;
- int v_text;
- int v_hotkey;
- int v_hottext;
- } WLINFO;
-
- /* header for rectangle buffers */
-
- typedef struct {
- long magic; /* Magic number to check if buffer installed */
- int vdihandle; /* VDI Handle of buffer (= VDIhandle) */
- int pxy[8]; /* Point XY array for memory buffer */
- MFDB mfdb,scr; /* Memory Form Definition Blocks of graphics */
- char data[]; /* Any extra data */
- } Buffer;
-
- typedef struct {
- char *accname; /* 8 character maximum accessory name */
- int acchandle; /* Accessory Application ID */
- int accposition;/* Menubar position to call */
- } ACCS;
-
- typedef struct {
- int textattributes[10]; /* Text saved attributes */
- int fillattributes[5]; /* Fill saved attributes */
- int lineattributes[6]; /* Line saved attributes */
- } XVDIVARS;
-
- extern int VDIhandle, hotkeylevel, buttonlevel, PopupVDIhandle;
- extern int hottextlevel, ColSupported, Life, Return, Ap_ID;
- extern int gr_cw, gr_ch, gr_bw, gr_bh, small_font, large_font;
- extern int color_font, image_w, image_h, big_img, num_colors;
- extern int num_planes, draw3dtype, cur_mouse, cur_mouse_form;
- extern int rsrc_array[15], pglobal[15], *rs_global, rsrc_objects;
- extern int rsrc_trees, TempVDIhandle, AEShandle;
- extern char *prgnameheader, *desk_accessories[6];
- extern void *_MainDispatcher, *_MainKeyDispatcher, *dpbuffer;
- extern void *dialbuffer, *winbuffer;
- extern ACCS Accessories[6];
- extern BOOL DesktopInstalled, MenusShown;
- extern MFDB screen;
- extern MICE mouseform;
- extern GRECT desk;
- extern APINFO globapinfo;
- extern OBJECT *MYALERT, *desktop, *iconpopup, *COMLINEELEMENT;
- extern OBJECT *wl_menubar, *WINELEM, *INTERNALMENU;
- extern WINDOW *WindowChain;
- extern RSXHDR *rs_hdr, hdr_buf;
- extern COOKIE *MainCJar;
- extern XVDIVARS SaveHandles;
-
- /* External function bindings, used in all modules. This list is in
- alphabetical order; it makes more sense. */
-
- int ___DialEditDispatcher(WINDOW *win, int msg_buf[8]);
- int ___EditOptionDispatcher(WINDOW *win, int msg_buf[8]);
- int ___ExtOptionDispatcher(WINDOW *win, int msg_buf[8]);
- int ___ExtendedDispatcher(WINDOW *win, int msg_buf[8]);
- int ___MainHelpDispatcher(WINDOW *win, int msg_buf[8]);
- int ___MainOptionDispatcher(WINDOW *win, int msg_buf[8]);
-
- void box(int x, int y, int w, int h, int color);
- void box_fill(int x, int y, int w, int h, int color);
- long cookie_size();
- void create_cookie(COOKIE *cookie, long id, long value);
- void ddclose(int fd);
- int ddcreate(int apid, int winid, int msx, int msy, int kstate, char exts[]);
- int ddopen(int ddnam, char *preferext);
- int ddreply(int fd, int ack);
- int ddrtry(int fd, char *name, char *whichext, long *size);
- int ddstry(int fd, char *ext, char *name, long size);
- int dodialog(int vdihandle, OBJECT *tree, int skeleton, int outside);
- void domenu(WINDOW *win);
- void edit_off(WINDOW *win);
- void edit_on(WINDOW *win);
- void edit_pos(WINDOW *win, int where);
- void enddialog(OBJECT *tree);
- void fill(int x, int y, int color);
- void fillarea(int x1, int y1, int x2, int y2, int interior, int color);
- COOKIE *find_cookie(long id);
- int find_position(OBJECT *obj, int No, int mx);
- int fix_object(OBJECT *obj, int sizefix);
- int get_cookie(long cookie, long *value);
- long *get_cookiejar();
- void init_images(void);
- void init_mfdb(MFDB *fm, int *adr, int w, int h, int st, int pl);
- void line(int x1, int y1, int x2, int y2);
- int locate_object(WINDOW *win, char key);
- void move_cookiejar(long *dest, long size);
- int new_cookie(COOKIE *ent);
- void no_click(void);
- void point(int x, int y, int color);
- void position_fix(OBJECT *obj);
- int rc_intersect(GRECT *r1, GRECT *r2);
- int rc_inside(int x, int y, GRECT *r);
- void remove_cookie(long cookie_id);
- void reset_vdi(void);
- void restore_clip(void);
- void scale_image(OBJECT *obj, int mode);
- void scale_img(int *src, int w, int h, int mode, int *b_w, int *b_h);
- void *scrmove(void *buffer, int nx, int ny);
- void scrp_clear(void);
- int scrp_find(char *extension, char *filename);
- int scrp_init(char *path);
- int scrp_length(void);
- void scrrestore(void *buffer);
- void *scrsave(int vdihandle, int x, int y, int w, int h);
- void set_hotkey(int keylevel);
- void set_images(IMAGES *images, int **on, int **off);
- void setup_hotkeys(WINDOW *win);
- void showdialog(OBJECT *tree);
- void trans_image(OBJECT *obj);
- void unfix_object(OBJECT *obj);
- void vdi_trans(int w, int h, void *data);
- void vrt_copy(int *image, PARMBLK *pb, int color, int selected);
- int xrsrc_free(void);
- int xrsrc_gaddr(int re_gtype, int re_gindex, void *re_gaddr);
- int xrsrc_load(const signed char *re_lpfname);
- int xrsrc_obfix(OBJECT *re_otree, int re_oobject);
- int xrsrc_saddr(int re_stype, int re_sindex, void *re_saddr);
-
- int AlertDispatcher(WINDOW *win, int msg_buf[]);
- int CallControlPanel(OBJECT *menu_addr);
- void CallInternalHelp(void);
- void Change3DType(int type);
- void ChangeObjectText(OBJECT *obj, int idx, char *txt, int fnt, int just);
- void DoDeskMenu(OBJECT *menu);
- void DoHorizontalSlide(WINDOW *win, int number, int trackix,
- int slidix, int leftix, int rightix, int whichix,
- int trakstep, int strtrack);
- void DoVerticalSlide(WINDOW *win, int number, int trackix,
- int slidix, int upix, int downix, int whichix,
- int trakstep, int strtrack);
- void FixColIcon(ICONBLK *iconBlk,int planes,short *sData,
- short *sMask,short *dData,short *dMask,
- short *dtData,short *dtMask,short *cnvTab);
- int HoldSelection(void);
- void HorizontalSlideReset(WINDOW *win, int number, int maximum, int initial,
- int trackix, int slidix, int strtrack, int redraw);
- void InitCookies(void);
- void LockScreenUpdate(void);
- void Objc_Change(OBJECT *tree, int ob_cobject, int ob_crecvd, int ob_cnewstate, int ob_credraw);
- int PDoPopup(WINDOW *win, int index, OBJECT *menu_addr, int show, int x, int y, int w, int h);
- int PDoPopupAddr(OBJECT *tree);
- int PDoPopupDeskMenu(OBJECT *index, int *retbtn);
- void PDropdown_DialXY(OBJECT *srctree, int srcindex, OBJECT *desttree);
- void PDropdown_WinXY(WINDOW *win, int srcindex, OBJECT *desttree);
- int PEndPopupDesk(OBJECT *index);
- void PMovePopup(OBJECT *dial, int oldpos, int newpos);
- void PMovePopup_WinXY(WINDOW *win, int pindex, OBJECT *desttree);
- void PMovePopupCoord(OBJECT *desttree, int x, int y);
- int POpenPopupWorkspace(void);
- void PPopup_DialXY(OBJECT *srctree, int srcindex, OBJECT *desttree);
- void PPopup_WinXY(WINDOW *win, int srcindex, OBJECT *desttree);
- int PShowPopupDesk(OBJECT *index);
- void RFix_ObjectPos(OBJECT *obj);
- int Rsrc_Free(void);
- void TChangeTitleText(char *text);
- void TEndTitle(void);
- void TInitTitle(void);
- void TShowTitle(void);
- void UnlockScreenUpdate(void);
- void VerticalSlideReset(WINDOW *win, int number, int maximum, int initial,
- int slidix, int trackix, int strtrack, int redraw);
- int WAppl_GetInfo(int ap_gtype, int *ap_gout1, int *ap_gout2, int *ap_gout3, int *ap_gout4);
- void WAppl_SetupInfo();
- int WAscii_Table();
- void WCallAccessory(int buffernum);
- int WCallAlertDispatcher(WINDOW *win, int alexit, int alnumber);
- int WCallBtnDispatcher(WINDOW *win, int mx, int my, int button, int kstate, int bclicks);
- int WCallDlgDispatcher(WINDOW *win, int message);
- int WCallEtcDispatcher(int msg_buf[]);
- int WCallFKeyDispatcher(WINDOW *win, int fkeynum);
- int WCallHelpDispatcher(WINDOW *win);
- int WCallHotkeyDispatcher(WINDOW *win, int key, int objnum);
- int WCallIconifyDispatcher(WINDOW *win, int mode);
- int WCallKeyDispatcher(int key);
- int WCallResetDispatcher(WINDOW *win, int mode);
- int WCallStartupDispatcher(void);
- int WCallTMDDispatcher(WINDOW *win, int mode);
- int WCallTmrDispatcher(WINDOW *win);
- int WCallTxtDispatcher(WINDOW *win, int message);
- int WCallUndoDispatcher(WINDOW *win);
- int WCallWKeyDispatcher(WINDOW *win, int key);
- int WCallWndDispatcher(WINDOW *win, int msg_buf[]);
- void WCruelCloseWindow(WINDOW *win, BOOL icon);
- void WCloseWindow(WINDOW *win, int message);
- void WCreateTimer(WINDOW *win, int status, long ev_tcount, void *user);
- WINDOW *WCreateWindow(int state, int style, int kind,
- char *title, char *info,
- int object, int edobject,
- int menubar,
- int WndDispatcher(WINDOW *, int[]),
- void *user,
- int x, int y, int w, int h,
- OBJECT *obj, int dominance);
- void WDesk_ForceRedrawPortion(int x, int y, int w, int h);
- void WDesk_PortionRedraw(int object, int x, int y, int w, int h);
- void WDesk_Redraw(void);
- void WDesk_RedrawPortion(int x, int y, int w, int h);
- void WDo_Desk(int object, int initialclicks, int mouseforms);
- void DoDeskMenu(OBJECT *menu);
- int WDoDial(OBJECT *menu);
- void WDoElements(WINDOW *win, int obj);
- void WDie(int returns);
- void WDragBox(int width, int height, int beginx, int beginy,
- int boundx, int boundy, int boundw, int boundh,
- int linecolor, int linetype, int linepattern,
- int *endx, int *endy, int animate);
- int WDragBoxDesk(int object, int width, int height, int beginx, int beginy,
- int boundx, int boundy, int boundw, int boundh,
- int linecolor, int linetype, int linepattern,
- int *endx, int *endy, int animate, int mouseform);
- BOOL WFindAnyOpen(void);
- int WFindDominance(void);
- WINDOW *WFindIconWindow(int object);
- int WFindText(WINDOW *win, int mx, int my);
- int WFindUntoppables(void);
- BOOL WFindWindow(int treenumber);
- int WForm_button(WINDOW *win, int obj, int clicks, int *nxtobj);
- int WForm_keybd(WINDOW *win, int key, int kstate, int *nobj, int *nchr);
- int WFormCustAlert(int icn, char *text1, char *at1, char *at2, char *at3, char *at4, char *at5,
- char *bt1, char *bt2, char *bt3);
- void WGet_CInfo(int *wlv, int *xvv, int *txv, int *hkv, int *htv);
- void WGraf_Rubberbox(int bx, int by, int linecolor, int linetype, int linepattern,
- int *endx, int *endy, int animate);
- int WGrafMouse(int mo_sfield, ...);
- void WHotkeyLevel(int mode);
- void WHottextStyle(int style);
- void WIconify(WINDOW *win);
- int WInit(int ap_id, int *work_out,
- int DeskWndDispatcher(WINDOW *, int[]),
- int MainDispatcher(int[]),
- int KeyDispatcher(int),
- char *prgname, char *header, int dsk);
- void WInitAlert(void);
- void WInitAscii(void);
- void WInitElements(void);
- void WInitProcesses(void);
- int WIsTopped(int handle);
- WINDOW *WLocateWindow(long ident, ...);
- void WKillWindow(WINDOW *win);
- void WKillAllWindows(void);
- void WMoveWindow(WINDOW *win, int x, int y, int w, int h);
- void WMenuAttach(OBJECT *menubar, int menuitem, int popupobj, BOOL attach);
- int WMenuBar(OBJECT *me_btree, int me_bshow);
- void WMsgWindow(WINDOW *win, int msg_buf[]);
- void WObjc_Change(OBJECT *tree, int ob_cobject, int ob_crecvd, int ob_cnewstate, int ob_credraw);
- void WObjc_Draw(OBJECT *tree, int ob_cobject, int ob_cdepth, int clipx, int clipy, int clipw, int cliph);
- int WOpenWindow(WINDOW *win);
- void WReassignWindow(WINDOW *win,
- int state, int kind, char *title, char *info,
- int object, int edobject, int edpos,
- int menubar, int WndDispatcher(WINDOW *, int[]),
- void *user, int w, int h,
- OBJECT *obj, char textarray[], int redraw);
- void WRedrawAllWindows(void);
- void WRedrawWindow(WINDOW *win, int x, int y, int w, int h);
- int WRemove_Icon(int ic, int drag);
- void WScrollText(WINDOW *ws);
- void WSend_Msg(int sendto, int msg0, char *msg3, int msg5, int msg6, int msg7);
- void WSetup_Desktop(void);
- void WSetupText(WINDOW *win, int xd, int yd, int wd, int hd);
- void WStartTimer(WINDOW *win);
- void WStopTimer(WINDOW *win);
- void WTerm(void);
- int WTextAmount(WINDOW *win);
- void WTextFix(WINDOW *win);
- void WTextRedraw(WINDOW *win, int xd, int yd, int wd, int hd);
- TIMER *WTimerStat(WINDOW *win);
- void WTopWindow(WINDOW *win);
- void WUpdateWindowDlg(WINDOW *win, int x, int y, int w, int h, int obj);
- void WUpdateWindowMenu(WINDOW *win, int x, int y, int w, int h);
- void WUseInternalAccs(int show);
- int WWindGet(WINDOW *win, int wi_gfield, ...);
- int WWindSet(WINDOW *win, int wi_sfield, ...);
- int XVDI_NewTempVDIHandle(void);
- void XVDI_DeleteVDIHandle(void);
-